#include "udpClient.hpp"

#include <memory>
#include <cstdio>
#include <cstdlib>

using namespace Client;

//
static void Usage(void *proc)
{
    std::cerr << "\nUsage:\n\t" << proc << "serverip serverport\n\n";
}

// ./udpClient serverip serverport
int main(int argc, char *argv[])
{
    if (argc != 3)
    {
        Usage(argv[0]);
        exit(USAGE_ERROR);
    }

    std::string serverip = argv[1];
    uint16_t serverport = atoi(argv[2]);

    std::unique_ptr<udpClient> ucli(new udpClient(serverip, serverport));
    ucli->initClient();
    ucli->start();

    return 0;
}